import type { Entity } from './types'
import { type EntityType, putEntityType } from './core'

export type { Entity, Ref, Point2D } from './types'
export {
  entityTypeList,
  type EntityType,
  getEntityType,
  getEntityIdList,
  getEntityList,
  getEntityMap,
  getEntity
} from './core'
export { requestModel } from './api'
export * from './map-item'
export { default as EntityIdInput } from './EntityIdInput.vue'
// export {
//   type EntityTableCellValue,
//   type EntityTableColumn,
//   type EntityTableOptions,
//   selectAndShowEntityTable,
//   selectEntity,
//   selectEntityByType,
//   selectEntityType,
//   selectEntityIdByType,
//   selectEntityTypeId
// } from '../table'

export interface EntityTypeOptions<E extends Entity> extends EntityType {
  data: E[]
  // table?: EntityTableOptions<E>
}

export function registerEntityType<E extends Entity>({
  type,
  typeName,
  data // table
}: EntityTypeOptions<E>) {
  putEntityType({ type, typeName, data })
  // registerTableDefinition(Object.assign({ type }, table))
}

export function setupBase() {}
